/**
 * desc：
 * author：王文军
 * date：  2022/5/1 上午9:45
 */
const axios = require("axios");
const log = require("@wenjun-cli/log");

module.exports = {
  createComponent: async function (component) {
    try {
      const response = await axios.post(
        "http://127.0.0.1:8082/api/v1/components",
        component
      );
      const { data } = response;
      if (data.code === 0) {
        return data.data;
      }
      return null;
    } catch (e) {
      throw e;
    }
  },
};
